home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK1.toast / Development Kits (Disc 1) / Interfaces & Libraries / Interfaces / AIncludes / SoundComponents.a < prev    next >
Encoding:
Text File  |  1996-01-24  |  17.6 KB  |  655 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        SoundComponents.a
  3. ;
  4. ;    Contains:    Sound Components Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Package:    Universal Interfaces 2.2 in “MPW” on ETO #20
  8. ;
  9. ;    Copyright:    © 1984-1995 by Apple Computer, Inc.
  10. ;                All rights reserved.
  11. ;
  12. ;    Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13. ;                stack.  Include the file and version information (from above)
  14. ;                in the problem description and send to:
  15. ;                    Internet:    apple.bugs@applelink.apple.com
  16. ;                    AppleLink:    APPLE.BUGS
  17. ;
  18. ;
  19.  
  20.     IF &TYPE('__SOUNDCOMPONENTS__') = 'UNDEFINED' THEN
  21. __SOUNDCOMPONENTS__ SET 1
  22.  
  23.  
  24.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  25.     include 'Types.a'
  26.     ENDIF
  27. ;        include 'ConditionalMacros.a'                                ;
  28.  
  29.     IF &TYPE('__COMPONENTS__') = 'UNDEFINED' THEN
  30.     include 'Components.a'
  31.     ENDIF
  32. ;        include 'MixedMode.a'                                        ;
  33.  
  34.     IF &TYPE('__SOUND__') = 'UNDEFINED' THEN
  35.     include 'Sound.a'
  36.     ENDIF
  37. ;
  38. ;                        * * *  N O T E  * * *
  39. ;
  40. ;    This file has been updated to include Sound Manager 3.1 interfaces.
  41. ;
  42. ;    Some of the Sound Manager 3.0 interfaces were not put into the InterfaceLib
  43. ;    that originally shipped with the PowerMacs. These missing functions and the
  44. ;    new 3.1 interfaces have been released in the SoundLib library for PowerPC
  45. ;    developers to link with. The runtime library for these functions are
  46. ;    installed by Sound Manager 3.1. The following functions are found in SoundLib.
  47. ;
  48. ;        AudioGetBass, AudioGetInfo, AudioGetMute, AudioGetOutputDevice,
  49. ;        AudioGetTreble, AudioGetVolume, AudioMuteOnEvent, AudioSetBass,
  50. ;        AudioSetMute, AudioSetToDefaults, AudioSetTreble, AudioSetVolume,
  51. ;        OpenMixerSoundComponent, CloseMixerSoundComponent, SoundComponentAddSource,
  52. ;        SoundComponentGetInfo, SoundComponentGetSource, SoundComponentGetSourceData,
  53. ;        SoundComponentInitOutputDevice, SoundComponentPauseSource,
  54. ;        SoundComponentPlaySourceBuffer, SoundComponentRemoveSource,
  55. ;        SoundComponentSetInfo, SoundComponentSetOutput, SoundComponentSetSource,
  56. ;        SoundComponentStartSource, SoundComponentStopSource
  57. ;
  58. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  59. ; constants
  60. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  61.  
  62. ;sound component set/get info selectors
  63. siVolume                        EQU        'volu'
  64. siHardwareVolume                EQU        'hvol'
  65. siSpeakerVolume                    EQU        'svol'
  66. siHeadphoneVolume                EQU        'pvol'
  67. siHardwareVolumeSteps            EQU        'hstp'
  68. siHeadphoneVolumeSteps            EQU        'hdst'
  69. siHardwareMute                    EQU        'hmut'
  70. siSpeakerMute                    EQU        'smut'
  71. siHeadphoneMute                    EQU        'pmut'
  72. siRateMultiplier                EQU        'rmul'
  73. siQuality                        EQU        'qual'
  74. ;format types
  75. kOffsetBinary                    EQU        'raw '
  76. kTwosComplement                    EQU        'twos'
  77. kMACE3Compression                EQU        'MAC3'
  78. kMACE6Compression                EQU        'MAC6'
  79.  
  80. ;quality flags
  81. ;use interpolation in rate conversion
  82. kBestQuality                    EQU        (1 << 0)
  83.  
  84. ;useful bit masks
  85. kInputMask                        EQU        $000000FF            ;masks off input bits
  86. kOutputMask                        EQU        $0000FF00            ;masks off output bits
  87. kOutputShift                    EQU        8                    ;amount output bits are shifted
  88. kActionMask                        EQU        $00FF0000            ;masks off action bits
  89. kSoundComponentBits                EQU        $00FFFFFF
  90.  
  91. ;SoundComponentPlaySourceBuffer action flags
  92. kSourcePaused                    EQU        (1 << 0)
  93. kPassThrough                    EQU        (1 << 16)
  94. kNoSoundComponentChain            EQU        (1 << 17)
  95. ;flags for OpenMixerSoundComponent
  96. kNoMixing                        EQU        (1 << 0)            ;don't mix source
  97. kNoSampleRateConversion            EQU        (1 << 1)            ;don't convert sample rate (i.e. 11 kHz -> 22 kHz)
  98. kNoSampleSizeConversion            EQU        (1 << 2)            ;don't convert sample size (i.e. 16 -> 8)
  99. kNoSampleFormatConversion        EQU        (1 << 3)            ;don't convert sample format (i.e. 'twos' -> 'raw ')
  100. kNoChannelConversion            EQU        (1 << 4)            ;don't convert stereo/mono
  101. kNoDecompression                EQU        (1 << 5)            ;don't decompress (i.e. 'MAC3' -> 'raw ')
  102. kNoVolumeConversion                EQU        (1 << 6)            ;don't apply volume
  103. kNoRealtimeProcessing            EQU        (1 << 7)            ;won't run at interrupt time
  104.  
  105. ;Audio Component constants
  106. ;Values for whichChannel parameter
  107. audioAllChannels                EQU        0                    ;All channels (usually interpreted as both left and right)
  108. audioLeftChannel                EQU        1                    ;Left channel
  109. audioRightChannel                EQU        2                    ;Right channel
  110. ;Values for mute parameter
  111. audioUnmuted                    EQU        0                    ;Device is unmuted
  112. audioMuted                        EQU        1                    ;Device is muted
  113. ;Capabilities flags definitions
  114. audioDoesMono                    EQU        (1 << 0)            ;Device supports mono output
  115. audioDoesStereo                    EQU        (1 << 1)            ;Device supports stereo output
  116. audioDoesIndependentChannels    EQU        (1 << 2)            ;Device supports independent software control of each channel
  117.  
  118. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  119. ; typedefs
  120. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  121. ;ShortFixed consists of an 8 bit, 2's complement integer part in the high byte,
  122. ;with an 8 bit fractional part in the low byte; its range is -128 to 127.99609375
  123. ; typedef short             ShortFixed
  124. ; typedef struct SoundComponentData  SoundComponentData
  125. ; typedef struct SoundComponentData  *SoundComponentDataPtr
  126. SoundComponentData         RECORD    0
  127. flags                     ds.l   1        ; offset: $0 (0)
  128. format                     ds.l   1        ; offset: $4 (4)
  129. numChannels                 ds.w   1        ; offset: $8 (8)
  130. sampleSize                 ds.w   1        ; offset: $A (10)
  131. sampleRate                 ds.l   1        ; offset: $C (12)
  132. sampleCount                 ds.l   1        ; offset: $10 (16)
  133. buffer                     ds.l   1        ; offset: $14 (20)
  134. reserved                 ds.l   1        ; offset: $18 (24)
  135. sizeof                     EQU *            ; size:   $1C (28)
  136.                         ENDR
  137.  
  138. ; typedef struct SoundParamBlock  SoundParamBlock
  139. ; typedef SoundParamBlock     *SoundParamBlockPtr
  140. SoundParamBlock         RECORD    0
  141. recordSize                 ds.l   1        ; offset: $0 (0)        ;size of this record in bytes
  142. desc                     ds     SoundComponentData ; offset: $4 (4) ;description of sound buffer
  143. rateMultiplier             ds.l   1        ; offset: $20 (32)        ;rate multiplier to apply to sound
  144. leftVolume                 ds.w   1        ; offset: $24 (36)        ;volumes to apply to sound
  145. rightVolume                 ds.w   1        ; offset: $26 (38)
  146. quality                     ds.l   1        ; offset: $28 (40)        ;quality to apply to sound
  147. filter                     ds.l   1        ; offset: $2C (44)        ;filter to apply to sound
  148. moreRtn                     ds.l   1        ; offset: $30 (48)        ;routine to call to get more data
  149. completionRtn             ds.l   1        ; offset: $34 (52)        ;routine to call when buffer is complete
  150. refCon                     ds.l   1        ; offset: $38 (56)        ;user refcon
  151. result                     ds.w   1        ; offset: $3C (60)        ;result
  152. sizeof                     EQU *            ; size:   $3E (62)
  153.                         ENDR
  154.  
  155. ; typedef void                 *SoundSource
  156. AudioInfo                 RECORD    0
  157. capabilitiesFlags         ds.l   1        ; offset: $0 (0)        ;Describes device capabilities
  158. reserved                 ds.l   1        ; offset: $4 (4)        ;Reserved by Apple
  159. numVolumeSteps             ds.w   1        ; offset: $8 (8)        ;Number of significant increments between min and max volume
  160. sizeof                     EQU *            ; size:   $A (10)
  161.                         ENDR
  162.  
  163. ; typedef struct AudioInfo     AudioInfo
  164. ; typedef AudioInfo         *AudioInfoPtr
  165. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  166. ; functions for sound components
  167. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  168. ;Sound Component dispatch selectors
  169.  
  170. ;these calls cannot be delegated
  171. kSoundComponentInitOutputDeviceSelect EQU        1
  172. kSoundComponentSetSourceSelect    EQU        2
  173. kSoundComponentGetSourceSelect    EQU        3
  174. kSoundComponentGetSourceDataSelect EQU        4
  175. kSoundComponentSetOutputSelect    EQU        5
  176. kDelegatedSoundComponentSelectors EQU        $0100                ;first selector that can be delegated up the chain
  177. ;these calls can be delegated and have own range
  178. kSoundComponentAddSourceSelect    EQU        kDelegatedSoundComponentSelectors + 1
  179. kSoundComponentRemoveSourceSelect EQU        kDelegatedSoundComponentSelectors + 2
  180. kSoundComponentGetInfoSelect    EQU        kDelegatedSoundComponentSelectors + 3
  181. kSoundComponentSetInfoSelect    EQU        kDelegatedSoundComponentSelectors + 4
  182. kSoundComponentStartSourceSelect EQU        kDelegatedSoundComponentSelectors + 5
  183. kSoundComponentStopSourceSelect    EQU        kDelegatedSoundComponentSelectors + 6
  184. kSoundComponentPauseSourceSelect EQU        kDelegatedSoundComponentSelectors + 7
  185. kSoundComponentPlaySourceBufferSelect EQU        kDelegatedSoundComponentSelectors + 8
  186.  
  187. ;Audio Component selectors
  188. kAudioGetVolumeSelect            EQU        0
  189. kAudioSetVolumeSelect            EQU        1
  190. kAudioGetMuteSelect                EQU        2
  191. kAudioSetMuteSelect                EQU        3
  192. kAudioSetToDefaultsSelect        EQU        4
  193. kAudioGetInfoSelect                EQU        5
  194. kAudioGetBassSelect                EQU        6
  195. kAudioSetBassSelect                EQU        7
  196. kAudioGetTrebleSelect            EQU        8
  197. kAudioSetTrebleSelect            EQU        9
  198. kAudioGetOutputDeviceSelect        EQU        10
  199. kAudioMuteOnEventSelect            EQU        129
  200.  
  201. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  202. ; Sound Manager 3.0 utilities
  203. ;
  204. ; pascal OSErr OpenMixerSoundComponent(SoundComponentDataPtr outputDescription, long outputFlags, ComponentInstance *mixerComponent)
  205. ;
  206.     IF ¬ GENERATINGCFM THEN
  207.         Macro
  208.         _OpenMixerSoundComponent
  209.             dc.w     $203C
  210.             dc.w     $0614
  211.             dc.w     $0018
  212.             dc.w     $A800
  213.         EndM
  214.     ELSE
  215.         IMPORT_CFM_FUNCTION    OpenMixerSoundComponent
  216.     ENDIF
  217.  
  218. ;
  219. ; pascal OSErr CloseMixerSoundComponent(ComponentInstance ci)
  220. ;
  221.     IF ¬ GENERATINGCFM THEN
  222.         Macro
  223.         _CloseMixerSoundComponent
  224.             dc.w     $203C
  225.             dc.w     $0218
  226.             dc.w     $0018
  227.             dc.w     $A800
  228.         EndM
  229.     ELSE
  230.         IMPORT_CFM_FUNCTION    CloseMixerSoundComponent
  231.     ENDIF
  232.  
  233. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  234. ; basic sound component functions
  235. ;
  236. ; pascal ComponentResult SoundComponentInitOutputDevice(ComponentInstance ti, long actions)
  237. ;
  238.     IF ¬ GENERATINGCFM THEN
  239.         Macro
  240.         _SoundComponentInitOutputDevice
  241.             dc.w     $2F3C
  242.             dc.w     $0004
  243.             dc.w     $0001
  244.             moveq    #0,d0
  245.             dc.w     $A82A
  246.         EndM
  247.     ELSE
  248.         IMPORT_CFM_FUNCTION    SoundComponentInitOutputDevice
  249.     ENDIF
  250.  
  251. ;
  252. ; pascal ComponentResult SoundComponentSetSource(ComponentInstance ti, SoundSource sourceID, ComponentInstance source)
  253. ;
  254.     IF ¬ GENERATINGCFM THEN
  255.         Macro
  256.         _SoundComponentSetSource
  257.             dc.w     $2F3C
  258.             dc.w     $0008
  259.             dc.w     $0002
  260.             moveq    #0,d0
  261.             dc.w     $A82A
  262.         EndM
  263.     ELSE
  264.         IMPORT_CFM_FUNCTION    SoundComponentSetSource
  265.     ENDIF
  266.  
  267. ;
  268. ; pascal ComponentResult SoundComponentGetSource(ComponentInstance ti, SoundSource sourceID, ComponentInstance *source)
  269. ;
  270.     IF ¬ GENERATINGCFM THEN
  271.         Macro
  272.         _SoundComponentGetSource
  273.             dc.w     $2F3C
  274.             dc.w     $0008
  275.             dc.w     $0003
  276.             moveq    #0,d0
  277.             dc.w     $A82A
  278.         EndM
  279.     ELSE
  280.         IMPORT_CFM_FUNCTION    SoundComponentGetSource
  281.     ENDIF
  282.  
  283. ;
  284. ; pascal ComponentResult SoundComponentGetSourceData(ComponentInstance ti, SoundComponentDataPtr *sourceData)
  285. ;
  286.     IF ¬ GENERATINGCFM THEN
  287.         Macro
  288.         _SoundComponentGetSourceData
  289.             dc.w     $2F3C
  290.             dc.w     $0004
  291.             dc.w     $0004
  292.             moveq    #0,d0
  293.             dc.w     $A82A
  294.         EndM
  295.     ELSE
  296.         IMPORT_CFM_FUNCTION    SoundComponentGetSourceData
  297.     ENDIF
  298.  
  299. ;
  300. ; pascal ComponentResult SoundComponentSetOutput(ComponentInstance ti, SoundComponentDataPtr requested, SoundComponentDataPtr *actual)
  301. ;
  302.     IF ¬ GENERATINGCFM THEN
  303.         Macro
  304.         _SoundComponentSetOutput
  305.             dc.w     $2F3C
  306.             dc.w     $0008
  307.             dc.w     $0005
  308.             moveq    #0,d0
  309.             dc.w     $A82A
  310.         EndM
  311.     ELSE
  312.         IMPORT_CFM_FUNCTION    SoundComponentSetOutput
  313.     ENDIF
  314.  
  315. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  316. ; junction methods for the mixer, must be called at non-interrupt level
  317. ;
  318. ; pascal ComponentResult SoundComponentAddSource(ComponentInstance ti, SoundSource *sourceID)
  319. ;
  320.     IF ¬ GENERATINGCFM THEN
  321.         Macro
  322.         _SoundComponentAddSource
  323.             dc.w     $2F3C
  324.             dc.w     $0004
  325.             dc.w     $0101
  326.             moveq    #0,d0
  327.             dc.w     $A82A
  328.         EndM
  329.     ELSE
  330.         IMPORT_CFM_FUNCTION    SoundComponentAddSource
  331.     ENDIF
  332.  
  333. ;
  334. ; pascal ComponentResult SoundComponentRemoveSource(ComponentInstance ti, SoundSource sourceID)
  335. ;
  336.     IF ¬ GENERATINGCFM THEN
  337.         Macro
  338.         _SoundComponentRemoveSource
  339.             dc.w     $2F3C
  340.             dc.w     $0004
  341.             dc.w     $0102
  342.             moveq    #0,d0
  343.             dc.w     $A82A
  344.         EndM
  345.     ELSE
  346.         IMPORT_CFM_FUNCTION    SoundComponentRemoveSource
  347.     ENDIF
  348.  
  349. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  350. ; info methods
  351. ;
  352. ; pascal ComponentResult SoundComponentGetInfo(ComponentInstance ti, SoundSource sourceID, OSType selector, void *infoPtr)
  353. ;
  354.     IF ¬ GENERATINGCFM THEN
  355.         Macro
  356.         _SoundComponentGetInfo
  357.             dc.w     $2F3C
  358.             dc.w     $000C
  359.             dc.w     $0103
  360.             moveq    #0,d0
  361.             dc.w     $A82A
  362.         EndM
  363.     ELSE
  364.         IMPORT_CFM_FUNCTION    SoundComponentGetInfo
  365.     ENDIF
  366.  
  367. ;
  368. ; pascal ComponentResult SoundComponentSetInfo(ComponentInstance ti, SoundSource sourceID, OSType selector, void *infoPtr)
  369. ;
  370.     IF ¬ GENERATINGCFM THEN
  371.         Macro
  372.         _SoundComponentSetInfo
  373.             dc.w     $2F3C
  374.             dc.w     $000C
  375.             dc.w     $0104
  376.             moveq    #0,d0
  377.             dc.w     $A82A
  378.         EndM
  379.     ELSE
  380.         IMPORT_CFM_FUNCTION    SoundComponentSetInfo
  381.     ENDIF
  382.  
  383. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  384. ; control methods
  385. ;
  386. ; pascal ComponentResult SoundComponentStartSource(ComponentInstance ti, short count, SoundSource *sources)
  387. ;
  388.     IF ¬ GENERATINGCFM THEN
  389.         Macro
  390.         _SoundComponentStartSource
  391.             dc.w     $2F3C
  392.             dc.w     $0006
  393.             dc.w     $0105
  394.             moveq    #0,d0
  395.             dc.w     $A82A
  396.         EndM
  397.     ELSE
  398.         IMPORT_CFM_FUNCTION    SoundComponentStartSource
  399.     ENDIF
  400.  
  401. ;
  402. ; pascal ComponentResult SoundComponentStopSource(ComponentInstance ti, short count, SoundSource *sources)
  403. ;
  404.     IF ¬ GENERATINGCFM THEN
  405.         Macro
  406.         _SoundComponentStopSource
  407.             dc.w     $2F3C
  408.             dc.w     $0006
  409.             dc.w     $0106
  410.             moveq    #0,d0
  411.             dc.w     $A82A
  412.         EndM
  413.     ELSE
  414.         IMPORT_CFM_FUNCTION    SoundComponentStopSource
  415.     ENDIF
  416.  
  417. ;
  418. ; pascal ComponentResult SoundComponentPauseSource(ComponentInstance ti, short count, SoundSource *sources)
  419. ;
  420.     IF ¬ GENERATINGCFM THEN
  421.         Macro
  422.         _SoundComponentPauseSource
  423.             dc.w     $2F3C
  424.             dc.w     $0006
  425.             dc.w     $0107
  426.             moveq    #0,d0
  427.             dc.w     $A82A
  428.         EndM
  429.     ELSE
  430.         IMPORT_CFM_FUNCTION    SoundComponentPauseSource
  431.     ENDIF
  432.  
  433. ;
  434. ; pascal ComponentResult SoundComponentPlaySourceBuffer(ComponentInstance ti, SoundSource sourceID, SoundParamBlockPtr pb, long actions)
  435. ;
  436.     IF ¬ GENERATINGCFM THEN
  437.         Macro
  438.         _SoundComponentPlaySourceBuffer
  439.             dc.w     $2F3C
  440.             dc.w     $000C
  441.             dc.w     $0108
  442.             moveq    #0,d0
  443.             dc.w     $A82A
  444.         EndM
  445.     ELSE
  446.         IMPORT_CFM_FUNCTION    SoundComponentPlaySourceBuffer
  447.     ENDIF
  448.  
  449. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  450. ; interface for Audio Components
  451. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  452. ;Volume is described as a value between 0 and 1, with 0 indicating minimum
  453. ;  volume and 1 indicating maximum volume; if the device doesn't support
  454. ;  software control of volume, then a value of unimpErr is returned, indicating
  455. ;  that these functions are not supported by the device
  456. ;
  457. ; pascal ComponentResult AudioGetVolume(ComponentInstance ac, short whichChannel, ShortFixed *volume)
  458. ;
  459.     IF ¬ GENERATINGCFM THEN
  460.         Macro
  461.         _AudioGetVolume
  462.             dc.w     $2F3C
  463.             dc.w     $0006
  464.             dc.w     $0000
  465.             moveq    #0,d0
  466.             dc.w     $A82A
  467.         EndM
  468.     ELSE
  469.         IMPORT_CFM_FUNCTION    AudioGetVolume
  470.     ENDIF
  471.  
  472. ;
  473. ; pascal ComponentResult AudioSetVolume(ComponentInstance ac, short whichChannel, ShortFixed volume)
  474. ;
  475.     IF ¬ GENERATINGCFM THEN
  476.         Macro
  477.         _AudioSetVolume
  478.             dc.w     $2F3C
  479.             dc.w     $0004
  480.             dc.w     $0001
  481.             moveq    #0,d0
  482.             dc.w     $A82A
  483.         EndM
  484.     ELSE
  485.         IMPORT_CFM_FUNCTION    AudioSetVolume
  486.     ENDIF
  487.  
  488. ;If the device doesn't support software control of mute, then a value of unimpErr is
  489. ;returned, indicating that these functions are not supported by the device
  490. ;
  491. ; pascal ComponentResult AudioGetMute(ComponentInstance ac, short whichChannel, short *mute)
  492. ;
  493.     IF ¬ GENERATINGCFM THEN
  494.         Macro
  495.         _AudioGetMute
  496.             dc.w     $2F3C
  497.             dc.w     $0006
  498.             dc.w     $0002
  499.             moveq    #0,d0
  500.             dc.w     $A82A
  501.         EndM
  502.     ELSE
  503.         IMPORT_CFM_FUNCTION    AudioGetMute
  504.     ENDIF
  505.  
  506. ;
  507. ; pascal ComponentResult AudioSetMute(ComponentInstance ac, short whichChannel, short mute)
  508. ;
  509.     IF ¬ GENERATINGCFM THEN
  510.         Macro
  511.         _AudioSetMute
  512.             dc.w     $2F3C
  513.             dc.w     $0004
  514.             dc.w     $0003
  515.             moveq    #0,d0
  516.             dc.w     $A82A
  517.         EndM
  518.     ELSE
  519.         IMPORT_CFM_FUNCTION    AudioSetMute
  520.     ENDIF
  521.  
  522. ;AudioSetToDefaults causes the associated device to reset its volume and mute values
  523. ;(and perhaps other characteristics, e.g. attenuation) to "factory default" settings
  524. ;
  525. ; pascal ComponentResult AudioSetToDefaults(ComponentInstance ac)
  526. ;
  527.     IF ¬ GENERATINGCFM THEN
  528.         Macro
  529.         _AudioSetToDefaults
  530.             dc.w     $2F3C
  531.             dc.w     $0000
  532.             dc.w     $0004
  533.             moveq    #0,d0
  534.             dc.w     $A82A
  535.         EndM
  536.     ELSE
  537.         IMPORT_CFM_FUNCTION    AudioSetToDefaults
  538.     ENDIF
  539.  
  540. ;This routine is required; it must be implemented by all audio components
  541. ;
  542. ; pascal ComponentResult AudioGetInfo(ComponentInstance ac, AudioInfoPtr info)
  543. ;
  544.     IF ¬ GENERATINGCFM THEN
  545.         Macro
  546.         _AudioGetInfo
  547.             dc.w     $2F3C
  548.             dc.w     $0004
  549.             dc.w     $0005
  550.             moveq    #0,d0
  551.             dc.w     $A82A
  552.         EndM
  553.     ELSE
  554.         IMPORT_CFM_FUNCTION    AudioGetInfo
  555.     ENDIF
  556.  
  557. ;
  558. ; pascal ComponentResult AudioGetBass(ComponentInstance ac, short whichChannel, short *bass)
  559. ;
  560.     IF ¬ GENERATINGCFM THEN
  561.         Macro
  562.         _AudioGetBass
  563.             dc.w     $2F3C
  564.             dc.w     $0006
  565.             dc.w     $0006
  566.             moveq    #0,d0
  567.             dc.w     $A82A
  568.         EndM
  569.     ELSE
  570.         IMPORT_CFM_FUNCTION    AudioGetBass
  571.     ENDIF
  572.  
  573. ;
  574. ; pascal ComponentResult AudioSetBass(ComponentInstance ac, short whichChannel, short bass)
  575. ;
  576.     IF ¬ GENERATINGCFM THEN
  577.         Macro
  578.         _AudioSetBass
  579.             dc.w     $2F3C
  580.             dc.w     $0004
  581.             dc.w     $0007
  582.             moveq    #0,d0
  583.             dc.w     $A82A
  584.         EndM
  585.     ELSE
  586.         IMPORT_CFM_FUNCTION    AudioSetBass
  587.     ENDIF
  588.  
  589. ;
  590. ; pascal ComponentResult AudioGetTreble(ComponentInstance ac, short whichChannel, short *Treble)
  591. ;
  592.     IF ¬ GENERATINGCFM THEN
  593.         Macro
  594.         _AudioGetTreble
  595.             dc.w     $2F3C
  596.             dc.w     $0006
  597.             dc.w     $0008
  598.             moveq    #0,d0
  599.             dc.w     $A82A
  600.         EndM
  601.     ELSE
  602.         IMPORT_CFM_FUNCTION    AudioGetTreble
  603.     ENDIF
  604.  
  605. ;
  606. ; pascal ComponentResult AudioSetTreble(ComponentInstance ac, short whichChannel, short Treble)
  607. ;
  608.     IF ¬ GENERATINGCFM THEN
  609.         Macro
  610.         _AudioSetTreble
  611.             dc.w     $2F3C
  612.             dc.w     $0004
  613.             dc.w     $0009
  614.             moveq    #0,d0
  615.             dc.w     $A82A
  616.         EndM
  617.     ELSE
  618.         IMPORT_CFM_FUNCTION    AudioSetTreble
  619.     ENDIF
  620.  
  621. ;
  622. ; pascal ComponentResult AudioGetOutputDevice(ComponentInstance ac, Component *outputDevice)
  623. ;
  624.     IF ¬ GENERATINGCFM THEN
  625.         Macro
  626.         _AudioGetOutputDevice
  627.             dc.w     $2F3C
  628.             dc.w     $0004
  629.             dc.w     $000A
  630.             moveq    #0,d0
  631.             dc.w     $A82A
  632.         EndM
  633.     ELSE
  634.         IMPORT_CFM_FUNCTION    AudioGetOutputDevice
  635.     ENDIF
  636.  
  637. ;This is routine is private to the AudioVision component.  It enables the watching of the mute key.
  638. ;
  639. ; pascal ComponentResult AudioMuteOnEvent(ComponentInstance ac, short muteOnEvent)
  640. ;
  641.     IF ¬ GENERATINGCFM THEN
  642.         Macro
  643.         _AudioMuteOnEvent
  644.             dc.w     $2F3C
  645.             dc.w     $0002
  646.             dc.w     $0081
  647.             moveq    #0,d0
  648.             dc.w     $A82A
  649.         EndM
  650.     ELSE
  651.         IMPORT_CFM_FUNCTION    AudioMuteOnEvent
  652.     ENDIF
  653.  
  654.     ENDIF ; __SOUNDCOMPONENTS__
  655.